package com.example.javaproject.thread.juc.blockingqueue;

/**
 * Description:
 * <br>Author：tian
 * <br>Time: 2019/3/5 15:41
 */
public class BufferWriter implements Runnable {
    private BoundedBuffer buffer;

    public BufferWriter(BoundedBuffer buffer) {
        this.buffer = buffer;
    }

    @Override
    public void run() {
        while (true) {
            try {
                buffer.put("iengchen");
                System.out.println(Thread.currentThread().getName() + ":写入成功");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
